#include "mygraphicsview.h"

#include <QWheelEvent>


MyGraphicsView::MyGraphicsView() : QGraphicsView(){}

MyGraphicsView::~MyGraphicsView(){}

void MyGraphicsView::wheelEvent(QWheelEvent *event)
{
    setTransformationAnchor(AnchorUnderMouse);
    double scalefactor = 1.1;

    if(event->delta() > 0) scale(scalefactor, scalefactor);
    else scale(1 / scalefactor, 1 / scalefactor);
}
